package com.foton.logistic.util;

import android.content.Context;
import android.os.Environment;

import com.foton.logistic.util.image.ImageUtil;
import com.foton.logistic.util.tool.LogUtil;

import java.io.File;

public class BaseConstant {

    public final static int TIMER_SECONDS									=  60;
    public static final String INTENT_SELECT ="INTENT_SELECT" ;
    public static final String ACTION_SELECT_FILTER ="ACTION_SELECT_FILTER" ;


    public static String IMAGETAMPPATH = Environment.getExternalStorageDirectory() + "/foton_logistic_app/";
    public static String IMAGESAVEPATH = Environment.getExternalStorageDirectory() + "/cache/";

    public static String IMAGETAMPFOLDER = "/cache/tamp/";//临时图片
    public static String IMAGESAVEFOLDER = "/cache/image/";//缓存图片
    public static String CACHENAME = "image";
    public static String APKPATH = "fotonlogistic.apk";
    public static final boolean IS_KEEP_LIVE = true;//活
    public static boolean DEBUGING = true;//调试
    public static boolean LOGING = false;//调试
    public static boolean COMPUL = true;//强制补充
    public static String LOGPATH = "";

    public static String getSaveImageFolder(Context context) {
        IMAGESAVEPATH = context.getExternalFilesDir("") + IMAGESAVEFOLDER;
        LOGPATH = ImageUtil.getSDPath()+"/afoton/log.txt";
        return IMAGESAVEPATH;
    }

    public static String getTampImageFolder(Context context) {
//        IMAGETAMPPATH = context.getExternalFilesDir("") + IMAGETAMPFOLDER;
        return IMAGETAMPPATH;
    }

    public static void initImagePath(Context context) {
        getSaveImageFolder(context);
        getTampImageFolder(context);
        APKPATH = context.getExternalFilesDir("") + "/cache/fotonlogistic.apk";
        File saveFile = new File(IMAGESAVEPATH);
        if (!saveFile.exists()) {
            saveFile.mkdirs();
        }
        File tampFile = new File(IMAGETAMPPATH);
        if (!tampFile.exists()) {
            tampFile.mkdirs();
        }
    }

    public static final int SCALE_WIDTH = 720;
    public static final int SCALE_HEIGHT = 720;
    public final static int PAGER_START = 0;
    public final static int PAGER_COUNT = 30;
    public final static int PAGER_START1 = 0;
    public final static int PAGER_COUNT1 = 20;
    public final static int MAX_PHOTO = 5;
    public final static int MAX_PHOTO1 = 4;
    public final static int UPLOAD_TRACK_NORMAL = 900000;//上传轨迹间隔时间
    public final static int UPLOAD_TRACK_RETRY  = 300000;//上传轨迹重试时间
//    public final static int UPLOAD_TRACK_NORMAL = 120000;//上传轨迹间隔时间
//    public final static int UPLOAD_TRACK_RETRY  = 60000;//上传轨迹重试时间

    public final static int UPLOAD_IMAGE_TYPE_START = 0;
    public final static int UPLOAD_IMAGE_TYPE_ARRIVE = 1;

    public final static int REQUEST_REFRESH = 9999;
    public static int LOCATION_RADIUS = 240;//定位精密度

    public static String INTENT_ST = "INTENT_ST";
    public static String INTENT_ID = "INTENT_ID";
    public static String INTENT_TYPE = "INTENT_TYPE";
    public static String INTENT_CONTENT = "INTENT_CONTENT";
    public static String INTENT_CLASS = "INTENT_CLASS";
    public static String INTENT_ARG = "INTENT_ARG";
    public final static String ACTION_ENBLE								    =  "ACTION_ENBLE";
    //广播标识
    public final static String ACTION_LOCATION_LOC = "ACTION_LOCATION_LOC";
    public final static String ACTION_ALARM = "com.foton.logistic.ALARM_ACTION";
    public final static String ACTION_MESSAGE = "ACTION_MESSAGE";
    public final static String ACTION_PUSH = "ACTION_PUSH";
    public final static String ACTION_HOME = "ACTION_HOME";
    public final static String ACTION_ORDER_REFRESH = "ACTION_ORDER_REFRESH";
    public final static String ACTION_LOCATION = "ACTION_LOCATION";

    //Extranet
   /* public final static String SERVICE_HOST_IP = "http://172.16.23.56:8080/openapi/iov/vlogistics2/";
    public final static String SERVICE_HOST_IP_LAN_IMG = "http://172.16.23.56:8080";*/
    /*public final static String SERVICE_HOST_IP = "http://172.24.7.176:8180/openapi/iov/vlogistics/";
    public final static String SERVICE_HOST_IP_LAN_IMG = "http://172.24.7.176:8180";*/
//    //Intranet
 /*public final static String SERVICE_HOST_IP = "http://172.16.23.43:8080/openapi/iov/vlogistics2/";
   public final static String SERVICE_HOST_IP_LAN_IMG = "http://172.16.23.43:8080";*/
//    public final static String SERVICE_HOST_IP	 = "http://211.94.119.47:39090/";
//    public final static String SERVICE_HOST_IP_LAN_IMG = "http://211.94.119.47:39090";
//
//    public final static String SERVICE_HOST_IP	 = "http://111.203.1.134/";
//    public final static String SERVICE_HOST_IP_LAN_IMG = "http://111.203.1.134";

    public final static String SERVICE_HOST_IP	 = "http://saas.ifoton.com.cn/openapi/iov/vlogistics2/";
    public final static String SERVICE_HOST_IP_LAN_IMG = "http://saas.ifoton.com.cn";
  /*  public final static String SERVICE_HOST_IP	 = "http://ov.ifoton.com.cn/";
    public final static String SERVICE_HOST_IP_LAN_IMG = "http://ov.ifoton.com.cn";*/
    
    public final static String SERVICE_HOST_IP_LAN = SERVICE_HOST_IP + "/";

    public final static String SERVICE_HOST_IP_LANS = SERVICE_HOST_IP + "/";
    public final static String baiduUrl1 = "http://api.map.baidu.com/telematics/v3/weather";
    public final static String carrier = SERVICE_HOST_IP +"councils/getCarrier.json";
    public final static String getCarrierAdd=SERVICE_HOST_IP + "councils/getCarrierAdd.json";
    public final static String checkCarrier=SERVICE_HOST_IP + "councils/checkCarrier.json";
    public final static String getCarrierList=SERVICE_HOST_IP + "councils/getCarrierList.json";
    public final static String getRemindMessage=SERVICE_HOST_IP + "pushMsg/getRemindMessage.json";
    public static String VERSION = SERVICE_HOST_IP + "version/checkVersion.json";
   // http://172.16.23.43:8080/openapi/iov/vlogistics2/vlogistics2/TransferTMSController/uploadAccidentOrder.json
    public static final String UPLOAD_ABNORMAL_ACCIDENT = SERVICE_HOST_IP + "TransferTMSController/uploadAccidentOrder.json?token=acbc61ddcad5375b450ac5c6e1dc238a";
    //短信验证码
    public final static String CONFIRMWORD								=  SERVICE_HOST_IP+"user/getConfirmCode.json";
    //注册
    //public final static String REGISTER = SERVICE_HOST_IP + "user/register.json?token=3d0698bac419ca50fd4abe81f75154ed";
    public final static String REGISTER = SERVICE_HOST_IP + "user/register.json?token=acbc61ddcad5375b450ac5c6e1dc238a";
    public final static String forgetPassword = SERVICE_HOST_IP + "user/forgetPassword" + ".json";
    /**
     * 登录
     * 请求方式：Post
     */
    public final static String LOGIN = SERVICE_HOST_IP + "user/getLogin.json";
    /**
     * 修改手机号
     * 请求方式：Post
     */
    public final static String changeTelphone = SERVICE_HOST_IP + "user/changeTelphone" +
            ".json";


    /**
     * 修改密码
     * 请求方式：Post
     */
    public final static String MODIFY_PASSWORD = SERVICE_HOST_IP + "user/changePassword" +
            ".json";
    /**
     * 获取个人信息
     * 请求方式：Post
     */
    public final static String GET_DRIVER_INFO = SERVICE_HOST_IP + "user/getDriverInfo" +
            ".json";
    /**
     * 获取订单列表
     * 请求方式：Post
     */
    public final static String GET_ORDER_LIST = SERVICE_HOST_IP + "order/getOrderList" +
            ".json";
    /**
     * 获取订单详情
     * 请求方式：Post
     */
    public final static String GET_ORDER_DETAIL = SERVICE_HOST_IP + "order/getOrderDetail" +
            ".json";
    /**
     * 接单
     * 请求方式：Post
     */
    public final static String ORDER_RECEIVE = SERVICE_HOST_IP + "orderRemark/orderReceive" +
            ".json";
    /**
     * 拒绝接单
     * 请求方式：Post
     */
    public final static String ORDER_REJECT = SERVICE_HOST_IP + "orderRemark/orderReject" +
            ".json";
    /**
     * 签到
     * 请求方式：Post
     */
    public final static String ORDER_SIGN = SERVICE_HOST_IP + "orderRemark/orderSign" +
            ".json";
    /**
     * 上传图片
     * 请求方式：Post
     */
    //public final static String UPLOAD_IMAGE = SERVICE_HOST_IP + "orderRemark/uploadOrderImage.json?token=3d0698bac419ca50fd4abe81f75154ed";
    public final static String UPLOAD_IMAGE = SERVICE_HOST_IP + "orderRemark/uploadOrderImage.json?token=acbc61ddcad5375b450ac5c6e1dc238a";
    /**
     * 上报异常
     * 请求方式：Post
     */
    //public final static String UPLOAD_ABNORMAL = SERVICE_HOST_IP + "orderRemark/uploadAbnormal.json?token=3d0698bac419ca50fd4abe81f75154ed";
    public final static String UPLOAD_ABNORMAL = SERVICE_HOST_IP + "orderRemark/uploadAbnormal.json?token=acbc61ddcad5375b450ac5c6e1dc238a";

    /**
     * 上传轨迹
     * 请求方式：Post
     */
    public final static String UPLOAD_LATLNG = SERVICE_HOST_IP +
            "orderRemark/uploadTrack.json";
    /**
     * 设备登入、断开
     * 请求方式：Post
     */
    public final static String DEVICE_CONNECT = SERVICE_HOST_IP +
            "orderRemark/deviceConnect.json";
    public final static String setPush = SERVICE_HOST_IP + "user/setPushInfo.json";

    public static void initDebug() {
        LogUtil.setShowLogEnabled(DEBUGING);
    }


}
